package com.lxy.ioc.component;

import com.lxy.ioc.model.UserInfo;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class UserInfoComonent {

    @Bean
    public UserInfo userInfo(){
        return new UserInfo("zhangsan",29);
    }

    @Bean
    public UserInfo userInfo1(){
        return new UserInfo("lisi",23);
    }
    @Bean
    public String name(){
        return "cxk";
    }
    @Bean
    public String name1(){
        return "mjq";
    }
    @Bean
    public UserInfo userInfo2(@Qualifier("name") String name3) { return new UserInfo(name3,34);}
}
